DateChange takes either a date string and converts it to the number of days since 1/02/0000 or takes the number of days since 1/02/0000 and returns the corresponding date string.
DateChange requires two parameters. String; LongInt. Respectively.
Call with the format DateChange(var1;var2) where var1 is a String and var2 is an Integer.
Date string needs to be in the format "MM/DD/YYYY"
If LongInt=0 then the date will be converted to a number and returned in LongInt.
If longint<>0 then the Longint will be converted to a date and returned in string.
Notes:
Every four years is a leap year, ALWAYS. I don't cancel leap years on centuries where the century/100 and then divided by 4 <> 0 (as per the 'rule')
I don't check for the date in 1742 (?) when 10 days were skipped because of changes made by the Gregorian calendar change.
Use the 4D External Mover to copy DateChange from Date.EXT into either a Proc.ext file or into the .res file of your application.
This application was written and compiled with TurboPascal.